perm filename LECT2.TEX[ARK,TEX] blob
sn#766828 filedate 1984-08-20 generic text, type C, neo UTF8
COMMENT ā VALID 00024 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00004 00002 % copyright 1984 by Arthur Keller ... All rights reserved
C00006 00003 \section{Introduction to the TOPS-20 Operating System}
C00008 00004 \subsection{Learning to Use the Terminal}
C00018 00005 \subsection{Starting a Terminal Session}
C00019 00006 \subsubsection{Hardwired Terminals}
C00021 00007 \subsubsection{Dial-up Terminals}
C00022 00008 \subsubsection{Ethernet Terminals}
C00025 00009 \subsection{Identifying Yourself to the System: Logging In}
C00029 00010 \subsection{Some Easy EXEC Commands}
C00033 00011 \subsection{Leaving the System: Logging Out}
C00035 00012 \section{Files and What to Do With Them}
C00038 00013 \subsection{File Specifications}
C00043 00014 \section{Introduction to the BEMACS Text Editor}
C00044 00015 \subsection{EMACS Documentation}
C00046 00016 \subsection{Running EMACS}
C00048 00017 \subsection{BEMACS---Beginners EMACS}
C00051 00018 \subsection{Basic Editing with EMACS}
C00053 00019 \subsection{Commands Common to All Terminals}
C00059 00020 \subsection{Keypad for the Zenith Terminals}
C00061 00021 \subsection{Keypad for the VT100 Terminals}
C00064 00022 \subsection{Exiting EMACS}
C00065 00023 \subsection{Helpful Hints for EMACS}
C00066 00024 \section{Running \TeX\ on TOPS-20}
C00069 ENDMK
Cā;
% copyright 1984 by Arthur Keller ... All rights reserved
\chapter{TOPS-20 and BEMACS Brief Intro}
%Mon, August 20
%10-11am
%TOPS-20 and BEMACS brief intro
%>Login, logout
%>BEMACS (Basic version of EMACS)
%>Directory commands
%>Running TeX
In this section, we will learn a little about TOPS-20, the operating system
we will use, and BEMACS, the text editor we will use.
TOPS-20 is a fairly ``user-friendly'' operating system we will use, and it
runs on DECsystem-20 computers.
BEMACS is a basic version of EMACS that knows what commands you have been
taught to use, and when you try to use some other command, it makes
sure you know what you are doing.
\section{Introduction to the TOPS-20 Operating System}
%index<Terminals, hardwired>%index<Terminals, dial-up>
%index<Terminals, ethernet>%index<Ethernet, terminals>
People communicate with the computer by means of computer terminals.
We will be using the terminals in the Graduate School of Business B-5
laboratory in the basement of the GSB building.
There are three ways a terminal may be hooked up to a computer.
If a terminal is directly connected to a particular computer (that is, you
can use that terminal to talk only to that computer) it is referred to as
a hardwired terminal.
If the terminal communicates with the computer over the telephone lines,
it is called a dial-up terminal.
When a terminal is attached to the campus wide communications network
(referred to as the Ethernet), it is called an Ethernet terminal.
We will first describe some of the common characteristics of a terminal
and then give examples on how to use terminals when they are hooked up to
computers in different ways.
\subsection{Learning to Use the Terminal}
%index<Terminals, Use of>
%index<NOVICE Program>
There is an on-line tutorial designed to teach you some of the
fundamentals of working on the computer.
It is called {\tt NOVICE}.
To run the program, simply type {\tt NOVICE} to the {\tt @} prompt and press the
\ret\ key.
If you have time, it would be a good idea to both read this section and
run {\tt NOVICE}.
There is some overlap, but this section covers material not discussed by
{\tt NOVICE}, and {\tt NOVICE} demonstrates things to you directly instead
of just having you read.
%index<Cursor>
Since you ``talk'' to the computer by means of a computer terminal, you
must become familiar with terminals and how to use them.
Terminals have two main parts.
One part is a TV screen that displays what you type and what the computer
types in response.
An underline or a bright square on the TV screen marks the ``cursor,'' the
position where the next character that is typed will go.
The second part of the terminal is a keyboard that is similar to the
keyboard on a typewriter.
Study the terminal keyboard carefully to become familiar with the special
keys there.
%index<Keys, Special>%index<SHIFT key>
The {\tt SHIFT} key is used to form uppercase letters, just as on an
ordinary typewriter.
Normally when you type a key such as `{\tt H}', the character you get is
lowercase, that is, `{\tt h}'.
Hold down {\tt SHIFT} while typing a letter to get the uppercase letter,
`{\tt H}'{}.
Some keys have more than one symbol.
For example, there is a key labeled with `{\tt !}' above `{\tt 1}'{}.
To get a `{\tt 1}', type this key; to get `{\tt !}', hold down {\tt SHIFT}
and type this key.
In cases where there might be some confusion, we refer to the `{\tt !}'
character as {\tt SHIFT/1}{}.
%index<DELETE Key>%index<BACKSPACE Key>%index<RUBOUT Key>
The {\tt DELETE} key is one of the most useful things about using computer
terminals.
When you make a typing mistake, you may use the {\tt DELETE} key to erase
the last character on the current line.
If you type {\tt DELETE} again, another character goes away.
When you discover an error in the current line you are typing, use
{\tt DELETE} to erase back to the point where the error was made, then
correct the mistake and continue typing.
Instead of a {\tt DELETE} key, some terminals use the {\tt RUBOUT} or
{\tt BACKSPACE} keys.
%index<RETURN key>
Use the {\tt RETURN} key when you want to signal that you have finished
typing a line.
We will often use the symbol \ret\ to refer to the return key.
Usually commands or instructions that you type are executed when you type
{\tt RETURN}.
Generally, you may change the command by means of {\tt DELETE}, until you
type {\tt RETURN}.
%index<Control key> %index<Control Characters> %index<CTRL key>
Like the {\tt SHIFT} key, the {\sl Control} key, labeled {\tt CTRL}, is
held down while some other character is typed.
Characters formed in this way are called {\sl control characters}; they are
used to extend the vocabulary used when talking with the computer.
The following shorthand notation will refer to control characters in this
manual.
Rather than write ``hold down {\tt CTRL} and type {\tt C}'' or ``type control
{\tt C}'', ``{\tt CTRL/C}'' (or sometimes ``{\tt \caret C}'')
will be used to refer to control characters.
When a control character appears on your screen, it will usually be
printed in the form ``{\tt \caret C}''.
%index<CTRL/C>
{\tt CTRL/C} (control {\tt C}) is the character that you type
to initiate a terminal session.
{\tt CTRL/C} is also the interrupt character; type {\tt CTRL/C} twice to stop
most programs.
%index<CTRL/Q>
{\tt CTRL/Q} allows another {\sl screenful} of output to be shown.
The computer can fill a display screen (usually 24 lines) in just two
seconds, which is faster than most people can read.
Rather than deluge you with information, the computer pauses and beeps the
terminal whenever it fills up the screen.
Type {\tt CTRL/Q} to signify that you want to see more output.
%begin(warning)
{\sl
If the computer is waiting for you to type {\tt CTRL/Q}, nothing but {\tt
CTRL/Q} will make anything else appear on the screen.
If the terminal won't do anything for you, try typing {\tt CTRL/Q} before
seeking further assistance.
}
%end(warning)
%index<CTRL/U>
{\tt CTRL/U} erases the line you are currently typing.
Use {\tt CTRL/U} instead of many repetitions of {\tt DELETE} to erase the
entire line.
On some terminals the characters you delete will not be erased from the
screen, but the cursor will move to the left side of the screen; you may
then type over the old characters.
%index<CTRL/R>
The {\tt CTRL/R} character causes most programs to retype the input line.
If, while you are typing, your terminal receives a message, you may type
{\tt CTRL/R} to re-view your current line.
%index<CTRL/O>
Typing {\tt CTRL/O} makes the computer stop typing.
The computer will throw away terminal output.
The computer will resume typing output either when you type a second {\tt
CTRL/O} or when it pauses for further input.
This is useful if a program begins to type a large amount of material you
do not want to read.
You can abort the output without otherwise affecting the program.
%index<ESC key>
The terminal key labeled {\tt ESC} is called {\sl escape}.
This key is used for different purposes by different programs.
%index<SPACE key>
The space bar is the long unlabeled key along the edge of the keyboard
nearest you.
{\tt SPACE} is used to separate words in forming commands and in many
programming languages.
The terminal has special keys for the digits {\tt 1} and {\tt 0} (one and
zero).
These keys must not be confused with the keys for the letters lowercase
{\tt L} and uppercase {\tt O}.
Although these letters may look almost the same as the digits {\tt 1} and
{\tt 0}, you must use the digit keys when you are typing numbers.
There are many manufacturers of terminals and hence not all terminals are
alike.
Mostly they differ in the positioning of their keys, although they may
have some internal incompatibilities that might make transferring between
them difficult.
\subsection{Starting a Terminal Session}
Since there are three ways to hook a terminal to a computer, there are
three somewhat different ways to start a terminal session.
We will describe each of these ways.
\subsubsection{Hardwired Terminals}
%index<Terminals, hardwired> %index<Terminals, vacant>
Terminals that are hardwired to a Stanford DEC-20 display a distinctive
banner when they are vacant.
For example, a hardwired terminal on GSB-HOW would bear this message:
\smallskip
{\tt
\begin{center} \obeycr
Stanford GSB-HOW, TOPS-20 Monitor 5.3(5000)-4
\ {}
Welcome. To get started, hold down CTRL and type C.
\end{center}
}
\smallskip
To start a terminal session on such a terminal, you type {\tt CTRL/C}.
After a couple of seconds, the computer will respond with a message
something like:
\smallskip
{\tt\obeycr
\noindent Stanford GSB-HOW, TOPS-20 Monitor 5.3(5000)-4
@
}
\smallskip
The message identifies the system and sometimes includes a forecast of
system downtime or other messages of general interest.
The computer also types the `{\tt @}' (at-sign) character on the next
line.
This character is called a prompt; a prompt signifies that a program in
the computer is awaiting your next command.
The `{\tt @}' character signifies that the EXEC program is waiting to
serve you.
The EXEC is the program which enables you to create files, run other
programs, log in, log out, and so forth.
\subsubsection{Dial-up Terminals}
%index<Terminals, dial-up>%index<Modems>%index<Parity>%index<Stop bits>
%index<Baud rate>
With a modem and a terminal it is generally possible to use the telephone
system to connect to a computer.
We will not be using the computer in this course in this manner, though.
\subsubsection{Ethernet Terminals}
%index<Ethernet> %index<Ethertips> %index<Terminals, ethernet>
The Ethernet is a communications system that connects most of the major
computer systems at Stanford.
All of the Stanford DEC-20's are on the Ethernet.
The Ethernet can be used for logging on to computers as well as for
transferring data between computers.
There are small special purpose computers on the Ethernet called
``Ethertips'' that have anywhere from 8 to 48 terminals on them.
The Ethertip computer is responsible to connecting a terminal to a large
general purpose computer such as a DEC-20 and supervising the exchange of
characters between the terminal and the large computer.
The term ``host'' is often used to refer to a computer on the Ethernet.
From an Ethernet terminal it is generally possible to connect to any
computer on campus.
%index<Terminals, vacant>
A vacant Ethertip terminal will display a line similar to the following
example:
\smallskip
{\tt
Type anything for an Ethertip Exec!
}
\smallskip
If you type a character, such as \ret, you will get this message
\smallskip
{\tt \obeycr
\noindent Tip-GSB>
}
\smallskip
At this point, typing {\tt HOW\ret} will get you a connection to the
GSB-HOW computer.
If all goes well, the terminal will print ``{\tt is complete},'' then
print the system banner and the EXEC `{\tt @}' prompt.
If the terminal beeps when you type, you are typing something incorrect;
backspace if necessary, and make sure you have typed ``{\tt HOW\ret}''.
If you still cannot get it to work, ask someone for help.
\subsection{Identifying Yourself to the System: Logging In}
%index<Logging in>%index<LOGIN command>%index<Accounts, obtaining>
%index<Passwords>
You may now log in to the computer system.
Logging in means telling the computer who you are.
You must log in to gain access to your files and to use most programs.
You identify yourself by the LOGIN command, your user name and your
password.
An account on a DEC-20 permits you to use that computer and to store
computer files.
The password guards your account and files from use by anyone except
yourself.
You should not tell anyone else your password; your account is for your
use only, and not for anyone else.
If you have trouble logging in, ask a teaching assistant or your
instructor.
After you have successfully started a terminal session, the computer will
prompt for the next command by typing the `{\tt @}' character.
When the `{\tt @}' prompt is showing, type the word {\tt LOGIN}, a space,
your user name, another space, and your password.
Then press {\tt RETURN} (\ret).
Since your password is supposed to be secret, it will not appear on the
screen as you type it.
Your account name and your password should have been given to you when
you picked up your registration material.
What you type should be similar to the example below.
%index<LOGIN Command>
\smallskip
{\tt
@login k.texuser dingdong\ret
}
\smallskip
%index<System messages>%index<Frozen Account>%index<Accounts, frozen>
When this appears on the screen the password, {\tt dingdong}, will not be
visible.
Each time you log in, the system will offer you the chance to read any new
system messages.
These are messages which are of general interest to most users.
%index<Logging in, example>
{\tt\obeycr
\noindent @login k.texuser
Job 15 on TTY44 20-Aug-84 13:07
4 Aug 1984 1634-PDT Arthur Keller <K.ARK> Press return
(435 chars; more?)
}
You should press \ret\ to read these messages.
When you get the `{\tt @}' you are logged in and the EXEC program awaits
your next command.
\subsection{Some Easy EXEC Commands}
%index<EXEC, what it is>
The `{\tt @}' prompt signifies that a program called the EXEC is awaiting
your command.
The EXEC is a general purpose program that performs a wide variety of
chores for you.
It is the program that interprets the {\tt LOGIN} and {\tt LOGOUT}
commands.
The EXEC will run other programs for you, give you information about the
status of the system and the condition of your programs and files, and
will perform many other functions.
Whenever the EXEC is finished doing one command for you, it prompts for
another command by typing the `{\tt @}' character.
%index<CTRL/C>
When the EXEC runs some other program for you, that program may prompt for
commands.
In such a case, you must type commands for that program rather than typing
EXEC commands.
When a program that was started by the EXEC finishes running, it returns
you to the EXEC; the EXEC prompts with `{\tt @}'.
If you decide that you want to stop whatever program is running, you can
type {\tt CTRL/C} twice to make the EXEC stop the program and prompt for
an EXEC command.
%index<EXEC Commands>
%index<Command Arguments>
%index<Command Switches>
%index<Arguments, EXEC Command>
%index<Switches in EXEC Commands>
All EXEC commands start with a {\sl keyword} that tells the EXEC what to do.
Some commands require additional information.
Each item of additional information in a command is called an {\sl argument}
(or a {\sl switch}).
The precise nature of these arguments (or switches) will be discussed in
the sections on the particular commands.
Every EXEC command is terminated by pressing {\tt RETURN} (\ret).
{\tt RETURN} signifies that you are satisified that the command is correct
and that you now want the computer to do it.
Make sure the EXEC is prompting you with the `{\tt @}' prompt. Type
the word {\tt FINGER} and press {\tt RETURN} to see the names and locations
of everyone using the system. Sometimes the list fills the screen. If
this happens, just type {\tt CTRL/Q} to tell the computer to continue
typing information.
To see the current date and time, type {\tt DAYTIME}
and press {\tt RETURN}.
%index<DAYTIME Command>
\smallskip
{\tt\obeycr
\noindent @daytime
Monday, August 20, 1984 13:04:25
@
}
\smallskip
When the \TeX\ user asked for the daytime, it was 25 seconds after 1:04 in
the afternoon (that is, 13:04:25, using a 24-hour clock).
\subsection{Leaving the System: Logging Out}
%index<LOGOUT Command>
%index<LOGOFF Command>
%index<Ending a Session>
%index<Leave System>
Just as you informed the computer of your presence by logging in, you must
tell it you're leaving by logging out.
It is very important that you log out when you leave because, if you
don't, no one else can use the terminal, and someone else might use your
account and inadvertently damage your files.
To log out you must be at the `{\tt @}' prompt.
If you are not already at the `{\tt @}' prompt, typing {\tt CTRL/C} twice
usually will get you there.
Then you may log out by typing the command word {\tt LOGOUT} and pressing
{\tt RETURN} (\ret).
\smallskip
{\tt\obeycr
\noindent @logout\ret
SAMPLE.DVI [OK]
SAMPLE.IMP [OK]
Killed Job 15, User K.TEXUSER, TTY 44
at 20-Aug-84 13:58:24, Used 0:1:24 in 0:51:12
}
\smallskip
The message about the time used means that the computer actually
``worked'' 1 minute and 24 seconds for {\tt K.TEXUSER} during the
51~minutes and 12~seconds that he was logged in.
Extra files that are not needed (such as {\tt DVI} and {\tt IMP} files)
are deleted.
The next section tells more about files.
\section{Files and What to Do With Them}
%index<Files>%index<Disk Files>%index<Storing Programs>%index<Storing Data>%index<Storing Text>
Information such as commands, programs, or text can be saved in what are
called {\sl computer files}.
If you need to change the information contained in a file, there are
programs to help you change it without retyping the entire file.
A computer file is simply a collection of information that has a name.
Among the operations that you can perform on files are:
\begin{itemize}
\item Create a new file or modify the contents of an existing file ({\tt
EDIT} command).
\item Throw away the information in a file ({\tt DELETE} command).
\item Duplicate information from one file to another ({\tt COPY} command).
\item Obtain information on what files you currently have.
\end{itemize}
In order to use the computer effectively, you must learn how to do these
manipulations.
There are many ways to store information in a file.
Normally, if the information is text that must be entered by typing (that is,
information that you can read), you would use a special-purpose program
called a text editor.
There are several text editor programs on the DEC-20; the one called BEMACS
is recommended for beginners, and is described later in this manual.
Using the BEMACS program you can give a file a name and type in its
contents.
To find out what files you have, use the {\tt directory} command.
To delete file {\tt useless.tex}, say {\tt delete useless.tex}.
\subsection{File Specifications}
%index<File Specifications>%index<File Names>%index<Naming Files>
Many kinds of information may be stored in computer files: the text of
computer source programs, statistical data, etc.
Since you may have many files, each file has a name, formally called the
{\sl file specification}, by which you may refer to the file.
Usually you select a name that identifies the contents of the file.
For instance, suppose you write a Pascal language program that calculates
square roots.
You might call the file containing this program {\tt PROB1.TEX}, where {\tt
PROB1} is a common abbreviation for problem one, and {\tt TEX}
is the file type denoting a \TeX\ document source file.
A file specification is the {\sl handle} by which you can grasp and
manipulate the file and the information that it contains.
A file specification may have several parts.
One of the most common forms of file specification has two {\sl parts}---a
{\sl file name} and a {\sl file type}, separated from each other by a
period.
Thus, in the file specification {\tt PROB1.TEX}, ``{\tt PROB1}'' is the file
name and ``{\tt TEX}'' is the file type.
Both the name and type may be up to 39 characters long.
The file name is usually your free choice, selected to remind yourself of
what the file contains.
The choice of file type, however, is governed by convention.
Usually, the file type indicates what kind of information the file
contains.
Since the computer often uses the file type to determine what language the
program is written in, it is a good idea to follow the established
conventions.
You should always use ``{\tt TEX}'' as the file type of a \TeX\ source
file.
Some of the common file types that are used on the DEC-20 appear below:
\begin{center}
\begin{tabular}{l|l}
%index<File Types, List of>
Type&Meaning\\
\hline
{\tt TEX}&\TeX\ manuscript file\\
{\tt DVI}&Device independent output file\\
{\tt IMP}&IMagen Print format file\\
{\tt CMD}&EXEC command file (do not touch!)\\
{\tt INIT}&Initialization file (do not touch!)\\
{\tt PROFILE}&BEMACS profile file (do not touch!)\\
{\tt LST}&\TeX\ log file
\end{tabular}
\end{center}
In other documents, there are somewhat different conventions about what to
call the components of a file specification.
In less formal usage the entire specification may be called the ``file
name'' or just the ``name.''
In this manual, {\sl file name} means only one of the components of a file
specification.
However, ``name of the file'' may be used to mean ``file specification,''
wherever the latter seems too repetitious.
Also, the ``file type'' may be called the ``extension'' or ``file
extension'' in other documents.
\section{Introduction to the BEMACS Text Editor}
EMACS is a powerful, display-oriented text editor developed at MIT.
It features an extremely flexible macro facility (TECO) for customization
and extensibility, plus very complete internal documentation and help
facilities.
EMACS is a display editor.
That means that normally the text being edited is visible on the screen
and is updated automatically as you type your commands.
You see what you are editing rather than the commands you type to perform
the editing.
\subsection{EMACS Documentation}
Since EMACS is a real-time display editor, it is rather difficult to
describe it in published documentation.
Also, the novice may find him or herself bewildered by the apparent
complexity of the editor or by the need to memorize apparently hundreds of
commands in order to use it effectively.
This section attempts to introduce the reader to a few of the most basic
EMACS concepts and commands -- just enough to allow you to get started
using it, and to point you to further information when you decide you need
it.
There is an excellent tutorial on EMACS, available on-line. To use it,
run the program {\tt ETEACH}.
With this tutorial you learn basic EMACS commands by using EMACS
itself on a specially designed file which describes commands, tells
you when to try them, and then explains the results you see. It
gives a much more vivid description than a printed manual.
\subsection{Running EMACS}
Since EMACS is a display editor, it requires a terminal that can
selectively change parts of the screen.
This implies that it cannot be run on hardcopy and ``unsophisticated''
terminals.
We will be using Zenith 19 and DEC VT100 terminals, each of which
is capable of running EMACS, but slightly differently from each other.
To start editing an existing file, or to create a new one, type
{\tt EDIT} followed by the file name.
\smallskip
{\tt\obeycr
\noindent @edit sample.tex\ret
}
\smallskip
Once you have started EMACS it will clear your screen and display the file
you are editing.
To exit EMACS, type {\tt CTRL/X CTRL/Z} (two characters).
To edit another file in EMACS after having exited, give the {\tt EDIT}
command followed by the new file name again.
\subsection{BEMACS---Beginners EMACS}
As you will soon see, EMACS is a very powerful editor.
It has many, many commands.
A beginner will learn some subset of these commands and build up to the
more advanced features.
One problem with EMACS is that you can accidently give a command by
pressing a stray key.
If you don't know what that command does, you could become very confused.
For example, if you accidently press {\tt CTRL/W}, some portion of your file
will vanish.
Experienced users know to use the {\tt CTRL/Y} key to get it back, but
beginners can wipe out large parts of their file this way.
EMACS is full of land-mines.
In order to make life easier for the beginner, a novice library has been
defined.
The novice library has all of the simple commands and some of the
intermediate commands that are considered safe ({\tt CTRL/W} is not).
This version of EMACS is called BEMACS.
It works very simply.
Every EMACS command is either enabled or disabled, depending upon whether
it is in or not in the novice library.
If you try to use one of the commands that are enabled, everything works
the way it would in EMACS.
If you try to use something that is disabled, it will tell you that the
key is disabled.
It will ask you whether you {\sl really} want to do that command.
If it was a stray key that you pressed, you can say not to execute the
command.
It will give you the option of playing around with the command, though.
You can find out more information about it, try it just once, and even
enable it if you choose to.
If you enable a previously disabled key, BEMACS will remember it and let
you use the command freely from that point on.
Thus, you can customize BEMACS to do only the commands you understand.
Your directory has already been set up to use BEMACS.
If you wish to use some other editor, talk to the instructor or
a teaching assistant.
\subsection{Basic Editing with EMACS}
This section discusses only the most basic features of editing with
EMACS. You must know all the material presented here. However, to
use EMACS effectively, you will find that you need to memorize more
commands than is convenient in one reading or session. The ETEACH
tutorial presents a few more; try it after you
have read this section.
Text that you type while in EMACS is automatically inserted in the buffer
as you type it; EMACS commands are generally one or two control characters
which result in actions on the screen rather than being printed
themselves.
The commands may be entered by using control characters or by using the
keypad on the right of the keyboard.
\subsection{Commands Common to All Terminals}
Whenever you are working with EMACS, the cursor (the blinking underline or
white blob) indicates the position at which editing takes place.
Most of the commands we discuss here involve moving the cursor or deleting
text around the cursor.
The cursor is logically {\sl between} two characters, and should be thought
of as pointing immediately before the character that it appears on top of.
To insert printing characters into the text you are editing, just type
them.
They are inserted into the text at the cursor, and the cursor moves
forward.
Any characters on the line after the cursor move forward too.
If the text in the buffer is {\tt FOOBAR}, with the cursor before the {\tt
B}, then if you type {\tt XX} you get {\tt FOOXXBAR}, with the cursor
still before the {\tt B}.
To correct text you have just inserted, you can use {\tt DELETE} or {\tt
RUBOUT}.
The {\tt DELETE} key deletes the character {\sl before} the cursor (not
the one that the cursor is on top of or under; that is the character {\sl
after} the cursor).
The cursor and all characters after it move backwards.
Therefore, if you type a printing character and then type {\tt DELETE},
they cancel out.
Note that {\tt BACKSPACE} does not perform the same function in EMACS as
it normally does on a Stanford DEC-20; use {\tt DELETE} instead.
To end a line and start typing a new one, press {\tt RETURN}.
You can delete this line break with {\tt DELETE} just as you can delete
other characters; if you do so, the two lines are appended.
If you add too many characters to one line, without breaking it with a
{\tt RETURN}, the line will grow to occupy two (or more) lines on the
screen, with a ``!'' at the extreme right margin of all but the last of
them.
The ``!'' says that the following screen line is not really a distinct
line in the file, but just a continuation of a line too long to fit the
screen.
The command {\tt CTRL/L} will clear and redisplay the screen and will place
the place where you are in the file in the middle of the screen if the
file is big enough.
To delete to the end of a line, give the command {\tt CTRL/K} (while on
the line).
If you are already at the end of the line, this will join two lines.
Be careful about using \ret.
The \ret\ key will insert a line break in the input file right where
the cursor is.
If you are in the middle of a line, it will break the line in two
right there.
If you are at the end of a line, it will create a new blank line on the
next line (pushing everything down).
If you are at the beginning of a line, it will move the text down and insert
a blank line where you were.
If you have pressed \ret\ accidentally, try pressing the {\tt DELETE}
key immediately after to undo the effects of the \ret\ key.
If you are in the middle or beginning of the file, use the keypad or
keys labeled with arrows to move around.
You {\sl can}, however, safely use the \ret\ key at the end of the file
to move to the next line because you are creating a new line.
When you edit a file using EMACS, you are actually modifying a
copy of the file that shows on the screen.
If you make changes to the file and you want the changed version
to be saved and used, say, the next time you run \TeX, you will have
to get EMACS to save your file.
To save your file, type {\tt CTRL/X CTRL/S}; that is, hold down {\tt CTRL} and
press {\tt X} and {\tt S}, then let go of {\tt CTRL}.
You will get a message that your file has been saved.
This works on both the VT100 and the Zenith terminals.
You can also use the {\tt CTRL/X CTRL/S} command as a ``backup'' command
to save your work during your editing session, to prevent loss of data if
the system crashes.
\subsection{Keypad for the Zenith Terminals}
Each of the twelve keys on the keypad on the right side of the keyboard
has a label as listed below.
\begin{figure}[hbt]
\begin{center}
\begin{tabular}{|c|c|c|}
\hline
\hbox to 1in{IC\hfill}&\hbox to 1in{$\uparrow$\hfill}&\hbox to 1in{DC\hfill}\\
not used &Top of Screen &Kill Word\\
--- --- --- &--- --- --- &--- --- ---\\
not used &Up One Line &Kill Char\\
7\hfill &8\hfill &9\hfill\\
\hline
$\leftarrow$\hfill&HOME\hfill &$\rightarrow$\hfill\\
Beginning of Line&Backward Window&End of Line\\
--- --- --- &--- --- --- &--- --- ---\\
Backward Char &Forward Window &Forward Char\\
4\hfill &5\hfill &6\hfill\\
\hline
IL\hfill &$\downarrow$\hfill&DL\hfill\\
Backward Paragraph&Bottom of Screen&Forward Paragraph\\
--- --- --- &--- --- --- &--- --- ---\\
Backward Word &Down Line &Forward Word\\
1\hfill &2\hfill &3\hfill\\
\hline
&&\\
Meta- &Ctrl-Meta- &Next Line\\
&&\\
0\hfill &.\hfill &Enter\hfill\\
\hline
\end{tabular}
\end{center}
\end{figure}
For example, pressing the `5' key will bring you to the next window
worth of your file.
Holding the shift key down while pressing the `5' key ({\sl home\/})
will move you backward to the previous window worth of your file.
\subsection{Keypad for the VT100 Terminals}
Each of the eighteen keys on the keypad on the right side of the keyboard
has a label as listed below.
\begin{figure}[hbt]
\begin{center}
\begin{tabular}{|c|c|c|c|}
\hline
``PF1'' & ``PF2'' & ``PF3'' & ``PF4'' \\
Find & Save & Copy & Unkill \\
file & file & region & text \\
\hline
``7'' & ``8'' & ``9'' & ``-'' \\
Beginning&Backwards& End of &Previous \\
of line ¶graph& line & screen \\
\hline
``4'' & ``5'' & ``6'' & ``,'' \\
Back kill& Delete &Frwd kill& Next \\
word &Character& word & screen \\
\hline
``1'' & ``2'' & ``3'' &``ENTER''\\
Backwards& Forward & Forward & \\
word ¶graph& word & \\
\hline
\multicolumn{2}{|c|}{``0''}& ``.'' & Exit \\
\multicolumn{2}{|c|}{Meta-}& Ctrl- & EMACS \\
\multicolumn{2}{|c|}{ } & Meta- & \\ % the { } is to prevent a msg
\hline
\end{tabular}
\end{center}
\end{figure}
For example, pressing the `,' key on the keypad will bring you to the next window
worth of your file.
Press the `-' key on the keypad
will move you backward to the previous window worth of your file.
In addition, the keys labeled with arrows above the main portion of the
keyboard move the cursor one position in the direction indicated.
\subsection{Exiting EMACS}
To exit EMACS, type {\tt CTRL/X CTRL/Z}; that is, hold down {\tt CTRL} and
press {\tt X} and {\tt Z}, then let go of {\tt CTRL}.
Make sure you have saved your file before exiting EMACS (if you want
your changes to be remembered or used by \TeX).
\subsection{Helpful Hints for EMACS}
If you run out of disk space while trying to save your file, EMACS will
give an error message ``{\tt ?Quota exceeded or disk full}, and will
return you to the EXEC leaving your screen a mess.
Type {\tt BLANK} to clear your screen, obtain more space (perhaps by {\tt
EXPUNGE}), then give a {\tt START} command to restart EMACS so you can
save your work.
If the message is immediately repeated, ask for help.
If nothing seems to work, try typing {\tt CTRL/G} a few times and see if
that helps.
\section{Running \TeX\ on TOPS-20}
To run \TeX\ on your document, you simply type {\tt tex document.tex} to
the Exec prompt (the {\tt @}) on the computer.
\TeX\ will then process the input file, display a number of messages to
your screen (which are also written to the {\tt .lst} file), and create the
{\tt .dvi} file containing your output.
When \TeX\ is finished, your screen should read
\smallskip
{\tt\obeycr
\noindent @TeXspool: document.dvi
}
\smallskip
You can then just press \ret, and ``TeXspool'' will
process your {\tt .dvi} file into a printable {\tt .imp} file, and then
request that it be printed.
\smallskip
{\tt\obeycr
\noindent Output written on PS:<K.ARK>TEXPUT.DVI.3 (1 page, 232 bytes).
Transcript written on PS:<K.ARK>TEXPUT.LST.3.
@TeXspool: PS:<K.ARK>TEXPUT.DVI.3
{}
PS:<K.ARK>TEXPUT.DVI.3
1 pages in file
{}
{}[1..] ==> DSK:TEXPUT.Imp
@canon DSK:TEXPUT.Imp
{}[Canon job TEXPUT queued, request \#46, limit 3]
}
\smallskip
You will get a message when the file starts printing and when it finishes
printing.
\smallskip
{\tt\obeycr
{}[From SYSTEM: Job TEXPUT request \#46 Started printing at 2:02:25]
{}
{}[From SYSTEM: Job TEXPUT request \#46 Finished printing at 2:02:51]
}
\smallskip
You can now pick up your output.